package com.zhuiYun.project.api.slideshow.mapper;

import com.zhuiYun.project.api.slideshow.entity.Slidsshow;
import com.zhuiYun.project.api.slideshow.model.slidesShowModel;
import com.zhuiYun.project.common.mapper.BaseMapper;
import com.zhuiYun.project.util.pageUtil.PageRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface slidesShowmapper extends BaseMapper<Slidsshow> {



    /**
     * @Author 小江
     * @Description //TODO 轮播图全查
     * @Date 9:32 2023/4/5
     **/


    @Select("<script>SELECT a.*,b.carousel_type AS carouselB" +
            " FROM slideshow a LEFT JOIN carousel b ON a.commdiy_id = b.id " +
            " where a.delete_flag = 0 " +
            "</script>")
    @Results({
            @Result(property="pcOrApp",column="pc_or_app"),
            @Result(property="imageId",column="image_id"),
            @Result(property="commdiyId",column="commdiy_id"),
            @Result(property="deleteFlag",column="delete_flag"),
            @Result(property="createTime",column="create_time"),
            @Result(property="carouselId",column="carousel_id"),
            @Result(property="diycommType",column="diycomm_type"),

    })
    List<Slidsshow> slidsShowList(PageRequest pageResult);
}
